/*
 * @Author: David Ma
 * @FilePath: \huaxia-real-estate-web\src\router\index.ts
 * @LastEditors: David Ma
 * @Description: 该文件用于配置路由
 * @Date: 2023-11-24 22:32:11
 */
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/login' },
    {
      path: '/',
      component: () => import('../layouts/default.vue'),
      children: [
        {
          path: 'dashboard',
          component: () => import('../pages/dashboard.vue'),
        },
        {
          path: 'account-settings',
          component: () => import('../pages/account-settings.vue'),
        },
        {
          path: 'typography',
          component: () => import('../pages/typography.vue'),
        },
        {
          path: 'icons',
          component: () => import('../pages/icons.vue'),
        },
        {
          path: 'cards',
          component: () => import('../pages/cards.vue'),
        },
        {
          path: 'tables',
          component: () => import('../pages/tables.vue'),
        },
        {
          path: 'form-layouts',
          component: () => import('../pages/form-layouts.vue'),
        },
        {
          path:'customer-managements',
          component: () => import('../pages/managements/customer-managements.vue'),
        },
        {
          path:'staff-managements',
          component: () => import('../pages/managements/staff-managements.vue'),
        },
        {
          path:'project-managements',
          component: () => import('../pages/managements/project-managements.vue'),
        },
        {
          path:'about',
          component: () => import('../pages/about/about.vue'),
        },
         {
          path:'my-projects',
          component: () => import('../pages/user-projects/my-projects.vue'),
        },
        {
          path:'example1',
          component: () => import('../pages/about/example1.vue'),
        },
        {
          path:'example2',
          component: () => import('../pages/about/example2.vue'),
        },
        {
          path:'my-messages',
          component: () => import('../pages/messages/my-messages.vue'),
        },
      ],
    },
    {
      path: '/',
      component: () => import('../layouts/blank.vue'),
      children: [
        {
          path: 'login',
          component: () => import('../pages/loginandregister/login.vue'),
        },
        {
          path: 'register',
          component: () => import('../pages/loginandregister/register.vue'),
        },
        {
          path: '/:pathMatch(.*)*',
          component: () => import('../pages/[...all].vue'),
        },
      ],
    },
  ],
})

export default router
